﻿using System;
using System.Collections.Generic;
using System.Xml;

namespace DNMeter.dom
{
	

	public class TestElement
	{
		protected Dictionary<string, TestElementProperty> properties; 

		protected XmlElement myElement;
		public XmlElement Element { get { return myElement; } }

		private void PopulateProps(){
			
		}

		public TestElementProperty GetProperty(string propertyName) {
			try
			{
				XmlNode node = myElement.SelectSingleNode(propertyName);
				if (node.Name == "elementProp" || !node.Name.EndsWith("Prop") )
				{
					return new TestElementElementProperty((XmlElement)node);
				}
				return new TestElementProperty((XmlElement)node);
			}
			catch (Exception e)
			{
				//Not a prop.
				Console.Error.WriteLine(e.Message);
			}
			return null;
		}
		public TestElementProperty this[string propertyName ] {
			get
			{
				return properties[propertyName] ;
			}
		}
		public TestElement(XmlElement element) {
			myElement = element;
		}
	}
	public class ThreadGroup : TestElement {
		
		public ThreadGroup(XmlElement elem) : base(elem) { 
			
		}
	}
}
